package day01_07.day03;

import java.util.Scanner;

/**
 * 排序子序列
 * https://www.nowcoder.com/questionTerminal/2d3f6ddd82da445d804c95db22dcc471?orderByHotValue=1&page=1&onlyReference=false
 */
public class Main01 {
    public static void main(String[] args){
        Scanner scn = new Scanner(System.in);
        String str = scn.next();
        int count = 0;
        int max = 0;
        int left = 0;
        int right = 0;
        for (int i = 0 ; i < str.length() ; i++){
            while ( i < (str.length()) && Character.isDigit(str.toCharArray()[i]) ){
                count ++;
                i ++ ;
                right = i;
            }

            if (max < count){
                max = count ;
                left = right - count;
            }
            count = 0;
        }
        for (int i = left; i < str.length(); i++) {
            System.out.print(str.toCharArray()[i]);
        }
    }
}
